# 访问   对象名称[开始索引:结束索引:不长]  三个参数都可以省略   左闭右开
x = [1, 2, 3, 8, 23, 11, 22]

for i in range(0,len(x) - 1):
    print(123)
# print(x[0])
# print(x[-1])
# print(x[:])访问全部
# print(x[:-1])访问全部
# print(x[::])访问全部
# print(x[:1000])访问全部
# print(x[1000:])返回空
# 访问偶数位
# print(x[::2])
# 访问奇数位
# print(x[1::2])


# 插入
# x = [1, 2, 3, 8, 23, 11, 22]
#
# x[2:] = [111,222,333]
# print(x[:])这种也是将x索引2以后元素替换

# x[3:6] = [111,222,333,444]
# # 这种形式是将3:6的元素进行了替换
# print(x[::])

# 在中间指定位置添加元素
# x[2:2] = [111,222]
# print(x[::])

# 在首部添加一个或者多个
# x[:0] = [111,222]
# print(x[::])

# 在尾部增加一个或者多个元素
# x[len(x):] = [111, 222]
# print(x[:])


# 修改
# x = [1, 2, 3, 8, 23, 11, 22]

# x[2:] = [111,222,333]
# print(x[::])

# 不相邻位置的元素要完成替换，左右侧元素数量要一致
# x[::2] = [0, 0, 0, 0]
# x[::2] = [0] * 4
# print(x[::])

# 删除

x = [1, 2, 3, 8, 23, 11, 22]

# 删除不相邻元素
# del x[::2]
# print(x[:])

# 删除连续元素
# x=x[:3]
# print(x[::])

# x=x[4:]
# print(x[::])


def solu(inpu):
    res = 0
    for i in range(0,len(inpu) - 1):
        if (res< inpu[i] *inpu[i+1]):
            res = inpu[i] *inpu[i+1]

    return res

if __name__ == '__main__':
    res = solu([3,5,-1,-2,8,9])
    print(res)
